﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SingletonPattern.Model;

namespace SingletonPattern.utils
{
    public sealed class CurrentSetting
    {
        public static Dictionary<string, object> Instance = new Dictionary<string, object>();
        private static object m_lock = new object();
        private CurrentSetting() { }
        public static object GetCurrentSetting(string key, object obj)
        {
            lock (m_lock)
            {
                if (!Instance.ContainsKey(key))
                    Instance.Add(key, obj);
            }
            return Instance[key];
        }
    }
}
